<template>
	<view class="page">
		<view class="bar_info" :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class="title_bar">
				<view class="title_bar_left" @tap.stop="handleJump" data-type="BACK">
					<image class="title_bar_left_icon" :src='STATIC_URL+"5.png"'></image>
				</view>
				<view class="title_bar_center">
					地址管理
				</view>
				<view class="title_bar_right"></view>
			</view>
		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#41AF36"></u-loading>
			<view class="loading_text">加载中</view>
		</view>
		<view class="set_content" v-else>
			<view class="address_name flex align-center justify-between">
				<view class="name">{{userInfo.consignee}}</view>
				<view class="phone">{{userInfo.tel}}</view>
			</view>
			<view class="address_text">
				{{userInfo.areaProvinces}} {{userInfo.areaCity}} {{userInfo.areaRegion}}{{userInfo.receiving_address}}
			</view>
			<view class="edit_info flex align-center justify-end">
				<view class="flex align-center" @tap.stop="handleJump" data-type="navigateTo" :data-url="`/pages/my/editAddress`">
					<image :src='STATIC_URL+"44.png"'></image>
					<text>编辑</text>
				</view>
				<!-- <view class="flex align-center" style="margin-left: 34rpx;">
					<image :src='STATIC_URL+"45.png"'></image>
					<text>删除</text>
				</view> -->
			</view>
		</view>
		
		<!-- <view class="btn_info">
			<view class="save_btn" @tap.stop="handleJump" data-type="navigateTo" :data-url="`/pages/my/editAddress`">新增地址</view>
		</view> -->
	</view>
</template>

<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		data() {
			return {
				mobile: "",
				userInfo: "",
				isShow: true,
			}
		},
		onLoad() {
			
		},
		onShow() {
			this.getUserInfo();
		},
		methods: {
			// 获取用户资料  postUserInfo
			getUserInfo() {
				this.$api.post(global.apiUrls.glyUser, {
					
				}).then(res => {
					// console.log(res);
					this.isShow = false;
					if (res.data.code == 200) {
						this.userInfo = res.data.data;
					} else {
						this.$message.info(res.data.message);
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://www.shiyaocanyin.com/images/8.png) no-repeat #f5f5f5;
		background-size: 100% auto !important;
		.bar_info {
			width: 750rpx;
			height: 88rpx;
			overflow: hidden;
			z-index: 10;
			position: fixed;
			top: 0rpx;
		
			.title_bar {
				padding: 0 32rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
		
				.title_bar_left {
					width: 50rpx;
					.title_bar_left_icon {
						width: 18rpx;
						height: 32rpx;
					}
				}
		
				.title_bar_center {
					line-height: 88rpx;
					font-size: 36rpx;
					font-weight: 400;
				}
		
				.title_bar_right {
					width: 50rpx;
				}
			}
		}
		.set_content {
			padding: 30rpx 20rpx;
			background: #fff;
			margin: 20rpx;
			border-radius: 10rpx;
			.address_name {
				.name {
					font-weight: 500;
					font-size: 36rpx;
					color: #3D3D3D;
				}
				.phone {
					font-weight: 400;
					font-size: 30rpx;
					color: #3D3D3D;
				}
			}
			.address_text {
				font-weight: 500;
				font-size: 24rpx;
				color: rgba(61,61,61,0.5);
				padding-bottom: 18rpx;
				border-bottom: 1px solid rgba(0,0,0,0.1);
			}
			.edit_info {
				margin-top: 20rpx;
				font-weight: 400;
				font-size: 24rpx;
				color: #3D3D3D;
				image {
					width: 30rpx;
					height: 30rpx;
					margin-right: 6rpx;
				}
			}
		}
	}
	.btn_info {
		width: 100%;
		height: 110rpx;
		position: fixed;
		bottom: 0;
		padding: 15rpx 25rpx;
		z-index: 10;
		.save_btn {
			width: 700rpx;
			height: 80rpx;
			background: #41AF36;
			border-radius: 50rpx;
			font-size: 30rpx;
			font-weight: 500;
			color: #fff;
			text-align: center;
			line-height: 80rpx;
			
		}
	}
	.codeLogin_fd1_1_c2 {
		font-size: 26rpx;
		color: #41AF36;
		font-weight: 500;
		margin-left: 30rpx;
	}
</style>